package nnet2.learning;

import java.util.ArrayList;
import java.util.Random;

public class TestMethods {
	public static double fibbonacci(double iters){
		double[] val = new double[2];
		val[0] = 0; 
		val[1] = 1;
		
		double sum = val[0] + val[1];;
		for (int i = 0; i < iters; i++) {
			sum = val[0]+val[1];
			val[0] = val[1];
			val[1] = sum;
		}
		
		return sum;
	}
        public ArrayList<Double> weightEqual1(double start, double stop, int step, int inMem, int outMem, int hidd){
            ArrayList<Double> res = new ArrayList<Double>((int)((stop-start)/step));
            ArrayList<Double> iter = new ArrayList<Double>((int)((stop-start)/step));
            for(double f = start; f < stop; f+=step){
                iter.add(f);
                
            }
            return res;
        }

        public static ArrayList<Double> sinWithDistortion(int size, double per, double dist, double randDist, double range){
            ArrayList<Double> res = new ArrayList<Double>(size);
            Random rand = new Random();
            double f = 0f;
            for(int i = 0; i < size; i++){
                f += 0.01f;
                res.add(range*((double)(Math.sin(per*f)*Math.sin(f/dist)+Math.sin(rand.nextDouble()*2*randDist - randDist))));
            }

            return res;
        }

        public static ArrayList<Double> constant(int size, double val){
            ArrayList<Double> res = new ArrayList<Double>(size);
            for(int i = 0; i < size; i++){
                res.add(val);
            }
            return res;
        }
}
